window.tywx || (window.tywx = {}),
    tywx.HttpUtil = {
        httpPost: function (e, t) {
            try {
                tywx.IsWechatPlatform() && wx.request({
                    url: e.url,
                    data: e.postData,
                    header: e.header,
                    method: "POST",
                    dataType: "json",
                    success: function (e) {
                        200 == e.statusCode ? e.data && e.data.hasOwnProperty("/api/bilog5/clientlog") && "ok" == e.data["/api/bilog5/clientlog"] && tywx.LOGD("ty.HttpUtil.httpPost", "post success! ") : tywx.LOGD("ty.HttpUtil.httpPost", "statusCode:" + e.statusCode);
                    },
                    fail: function (t) {
                        tywx.LOGD("ty.HttpUtil.httpPost", "post error! " + e.url);
                    }
                });
            } catch (e) {
                tywx.LOGE("error:", "tywx.HttpUtil.httpPost——" + JSON.stringify(e));
            }
        },
        httpGet: function (e, t, n) {
            try {
                tywx.IsWechatPlatform() && (tywx.LOGD("ty.HttpUtil.httpGet", "url:" + e.url), wx.request({
                    url: e.url,
                    method: "GET",
                    success: function (e) {
                        200 == e.statusCode ? (tywx.LOGD("ty.HttpUtil.httpGet", "res:" + JSON.stringify(e.data)),
                        t && t(e.data)) : tywx.LOGD("ty.HttpUtil.httpGet", "statusCode:" + e.statusCode);
                    },
                    fail: function (t) {
                        tywx.LOGD("ty.HttpUtil.httpGet", "post error! " + e.url), n && n(t);
                    }
                }));
            } catch (e) {
                tywx.LOGE("error:", "tywx.HttpUtil.httpGet——" + JSON.stringify(e));
            }
        }
    }
